import 'package:flutter_test/flutter_test.dart';
import 'package:andserver_flutter2/andserver_flutter2.dart';
import 'package:andserver_flutter2/andserver_flutter2_platform_interface.dart';
import 'package:andserver_flutter2/andserver_flutter2_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAndserverFlutter2Platform
    with MockPlatformInterfaceMixin
    implements AndserverFlutter2Platform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AndserverFlutter2Platform initialPlatform = AndserverFlutter2Platform.instance;

  test('$MethodChannelAndserverFlutter2 is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAndserverFlutter2>());
  });

  test('getPlatformVersion', () async {
    AndserverFlutter2 andserverFlutter2Plugin = AndserverFlutter2();
    MockAndserverFlutter2Platform fakePlatform = MockAndserverFlutter2Platform();
    AndserverFlutter2Platform.instance = fakePlatform;

    expect(await andserverFlutter2Plugin.getPlatformVersion(), '42');
  });
}
